x86/hvm/pmtimer: improving scalability of virtual time update
authorKeir Fraser <keir@xen.org>
Wed, 17 Nov 2010 17:28:17 +0000 (17:28 +0000)
committerKeir Fraser <keir@xen.org>
Wed, 17 Nov 2010 17:28:17 +0000 (17:28 +0000)
commit9e81df9a425cb5bde3dc05b9e4b3ce4fc8b1d77c
treeb8f111a1363552e00d89c126b5eaef3d88286bd3
parent9b231b6bc20bc55e55ed5511eb1b74ad3686ad94
x86/hvm/pmtimer: improving scalability of virtual time update

Mitigate the heavy contention on handle_pmt_io when running a HVM
configured with many cores (e.g., 32 cores). As the virtual time of a
domain must be fresh, there should be someone updating it,
periodically. But it is not necessary to let a VCPU update the virtual
time when another one has been updating it. Thus the update can be
skipped when the VCPU finds someone else is updating the virtual time.
So every time a VCPU invoke handle_pmt_io to update the current
domain's virtual time, it will first try to acquire the pmtimer lock.
If it succeeds, it will update the virtual time. Otherwise, it can
skip the update, waits for the pmtimer lock holder to finish updating
the virtual time and returns the updated time.

Signed-off-by: Xiang Song <xiangsong@fudan.edu.cn>
Signed-off-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/pmtimer.c